Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Constants and Data Types


DNS Query Information Structure

The DNS query information structure is used by the Domain Name Resolver (DNR) to return answers to DNS queries made using the OTInetQuery function. The DNS query information structure is defined by the DNSQueryInfo data type.

struct DNSQueryInfo {
   UInt16      qType;
   UInt16      qClass;
   UInt32      ttl;
   InetDomainNamename;
   UInt16      responseType;
   UInt16      resourceLen;
   char        resourceData[4];
};
typedef struct DNSQueryInfo DNSQueryInfo;
Field Description
qType
The DNS query type, such as MX and PTR, for which you wish to query.
qClass
The DNS query class, such as Inet and Hesiod, for which you wish to query.
ttl
An integer indicating the resource record's time to live (in seconds). To reduce network overhead, keep this value as low as possible.
name
The fully qualified domain name or address for which you are making the query. In the case of a CNAME data types, the name can be an alias or a partially qualified domain name, and if you use either of these, the OTInetQuery function returns a fully qualified canonical name.
responseType
The type of response. This can be an answer (a value of 2), an authority response (a value of 3), or additional information (a value of 4). Answers provide the information you are seeking (such as a resolved internet address), authority responses refer you to DNS servers and other sources that may have helpful information for this answer, and additional responses provide address data for the servers and sources referred to in the authority responses.
resourceLen
The actual length of the resource data returned.
resourceData
The resource data that is returned. This is at least 4 bytes long, and is usually longer.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996